package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.PurchaseAdd;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/PurchaseAddMapper.class */
public interface PurchaseAddMapper {
    @Select({"select *  from purchase_add where id = #{id}"})
    @ResultMap({"PurchaseAddMap"})
    PurchaseAdd queryById(Integer num);

    @Select({"select *  from purchase_add where purchase_type = #{purchaseType} and status = #{status}"})
    @Results(id = "PurchaseAddMap", value = {@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "purchase_num", property = "purchaseNum", jdbcType = JdbcType.VARCHAR), @Result(column = "first_type", property = "firstType", jdbcType = JdbcType.VARCHAR), @Result(column = "second_type", property = "secondType", jdbcType = JdbcType.VARCHAR), @Result(column = "count_unit", property = "countUnit", jdbcType = JdbcType.VARCHAR), @Result(column = "start_date", property = "startDate", jdbcType = JdbcType.VARCHAR), @Result(column = "purchase_type", property = "purchaseType", jdbcType = JdbcType.VARCHAR)})
    List<PurchaseAdd> queryAll(@Param("purchaseType") String str, @Param("status") Integer num);

    @Insert({"insert into purchase_add (purchase_num,first_type,second_type,unit,purchaser,count_unit,start_date,price,status,purchase_type) values(#{purchaseNum},#{firstType},#{secondType},#{unit},#{purchaser},#{countUnit},#{startDate},#{price},#{status},#{purchaseType})"})
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    Integer add(PurchaseAdd purchaseAdd);

    @Update({"update purchase_add set purchase_num = #{purchaseNum},first_type = #{firstType},second_type = #{secondType},unit = #{unit},purchaser = #{purchaser},count_unit = #{countUnit},start_date = #{startDate},price = #{price},purchase_type = #{purchaseType} where id = #{id}"})
    int update(PurchaseAdd purchaseAdd);

    @Delete({"delete from purchase_add where id = #{id}"})
    int deleteById(Integer num);

    @Update({"update purchase_add set status = #{status} where id = #{id}"})
    int updateByid(@Param("id") Integer num, @Param("status") Integer num2);
}